﻿// JScript 文件
$(function() {
    $( "#dialog:ui-dialog" ).dialog( "destroy" );
    $(window.parent.document).find("#contentTitle").text("告警上传>查看");
    $("#UploadBtn").button();
    $( "#dialog" ).dialog({
		autoOpen: false,
		closeOnEscape: false,
		bgiframe: true,
		modal: true,
		draggable: false,
        resizable: false,
		open: function(event,ui){ $(".ui-dialog-titlebar-close").hide(); }
	});
    $("#UploadBtn" ).click(function() {			  
		var mime = $("#AlarmInfo").val().substr($("#AlarmInfo").val().lastIndexOf('.')+1);
		if(mime.length > 0 && mime.toLowerCase() != "xls")
		{
		    alert("只能上传XLS格式的文件!");
		    return false;
		}	
		else
		{
		    $("#dialog").dialog( "open" );
		    return true;
		}
	});	
    $("body > div[role=dialog]").appendTo("form#form1");
});

